package org.swidgets.base.spanels;

import org.swidgets.base.BorderStyle;
import org.swidgets.base.BorderStyleRepository;
import org.swidgets.base.slabel.SLabel;


/**
 * 
 * Internal Class
 *
 */
public class TabWidget extends SFrame {
	private final static BorderStyle styleSelected = BorderStyleRepository.tabSelected;
	private final static BorderStyle styleUnselected = BorderStyleRepository.tabNotSelected;	
	private SLabel tabCaption = new SLabel();
		
	public TabWidget(String tabCaption){
		this();
		setCaption(tabCaption);
	}
	
	public TabWidget(){
		super();
		tabCaption.setWordWrap(false);
		tabCaption.setStyle(tabCaption.SMALL_TITLE_LABEL_STYLE);		
		setBodyWidget(tabCaption);
		unselect();
	}
	
	public void select(){
		setStyle(styleSelected);
	};

	public void unselect(){
		setStyle(styleUnselected);
	}

	public void setCaption(String title) {
		tabCaption.setText(title);
	};	
}
